define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'art.art_performance/index',
        add_url: 'art.art_performance/add',
        edit_url: 'art.art_performance/edit',
        delete_url: 'art.art_performance/delete',
        export_url: 'art.art_performance/export',
        modify_url: 'art.art_performance/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh',
                            [
                                {
                                    text: '添加',
                                    url: init.add_url,
                                    method: 'open',
                                    auth: 'add',
                                    class: 'layui-btn layui-btn-normal layui-btn-sm',
                                    icon: 'fa fa-plus ',
                                    extend: 'data-full="true"',
                                }
                            ],
                        ],
                cols: [[
                    {field: 'sort', title: '排序',edit:true,search: false},
                    {field: 'name', title: '演艺名称'},
                    {field: 'title', title: '标题'},
                    {field: 'img', minWidth: 80, title: '图片', search: false, templet: ea.table.image}, 
                    {field: 'address_name', title: '位置',search: false},
                    {field: 'add_time', title: '添加时间',search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                            [
                                {
                                    text: '编辑',
                                    url: init.edit_url,
                                    method: 'open',
                                    auth: 'edit',
                                    class: 'layui-btn layui-btn-success layui-btn-xs',
                                    extend: 'data-full="true"',
                                }
                            ],'delete'
                        ]
                    }
                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});